package com.cat.DataStructure04;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/contest/weekly-contest-478/problems/maximum-substrings-with-distinct-start/
 * @create 2025/11/30 10:33
 * @since JDK17
 */

public class Solution26 {
    public int maxDistinct(String s) {
        int [] h = new int[26];
        int ans = 0;
        for (var x : s.toCharArray()) {
            h[x - 'a']++;
        }
        for (int i = 0; i < 26; i++) {
            ans += h[i] != 0 ? 1 : 0;
        }
        return ans;
    }
}
